home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Learn Microsoft Visual Basic 6.0 Now
/
Learn Microsoft Visual Basic 6.0 Now (Microsoft Press)(X03-58607)(1998).ISO
/
media
/
chap06
/
b06d005.cc2
< prev
next >
Wrap
Text File
|
1998-06-07
|
1KB
|
32 lines
0, In this demonstration, you'll see how a
4, For...Next loop can modify the text size
6, on a form by using the form's FontSize
8, property. Now, every form has a FontSize
11, property, but to adjust it, you have to
13, use program code while the program is
14, running. We'll do this inside a
17, For...Next loop using the Print method we've been
19, demonstrating in this chapter. First,
21, we'll create a Command button to display
23, the output and give it the name Loop by
27, setting the Caption property in the
29, Properties window. Next, we'll create an
38, event procedure for the CommandButton's
39, Click event, and build a For...Next loop
42, that uses the Print method to display our
44, output. We'll display the loop ten
51, times. And each time through the loop, we'll
57, print the word Line plus the line
60, number, and we'll set the font size to be one
66, point larger each time. When we run the
77, program and click the Loop button, we
79, can see what happens. The For...Next loop
84, updates the FontSize property ten times
86, and displays ten lines. If you think
89, about it, the Visual Basic compiler has
90, actually executed the equivalent of 20
92, program statements here, although we only
94, typed four lines in the event procedure.
97, Pretty slick if you don't want to spend
98, your development time typing.
102, END